# ---------------------------------------------------------------------------------------------------- #
# _Fariss_HR_Accountability_README.txt
# ---------------------------------------------------------------------------------------------------- #

 Date: 2019-01-01

 Authors: Christopher J. Fariss

 Title: Yes, Human Rights are Improving

 Contact: 
   Chris Fariss: cjf0006@gmail.com

 Copyright (c) 2019, under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
 For more information see: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
 All rights reserved. 


# ---------------------------------------------------------------------------------------------------- #
# install R and necessary packages for analysis
# ---------------------------------------------------------------------------------------------------- #

open the .R file using any text or source code editor such as:
	TextEdit, emacs, Aquamacs, notepad++ , or Xpad

set the working directory to the folder containing the data files 

the set working directory command in R is setwd()
	type ?setwd for help documentation 

to set the path type into R: 

setwd("PATH_NAME")

where PATH_NAME is the path to the folder with the data

install packages if necessary:
	install.packages("MASS")
	install.packages("foreign")
	install.packages("reshape")
	install.packages("xtable")
	install.packages("rjags")
	install.packages("rstan")
	install.packages("plotrix")
	install.packages("gtools")


You should place the folders that contain this file and the additional folders it contains into the R working directory. 

The R working directory is available via the getwd() function in R.

The attached code makes use of the file structure. As long as the folders are in the R working directory the script will find these files and work properly. 

The last version of R and Mac OS-X are:

R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

The rjags library will only install after the successful installation of JAGS, which can be downloaded here: http://mcmc-jags.sourceforge.net/


# ---------------------------------------------------------------------------------------------------- #
# file descriptions
# ---------------------------------------------------------------------------------------------------- #

_Fariss_HR_Accountability_README.txt --- README fileFigure1_Figure2_SIM_JAGS_Dynamic_IRT.R --- R scriptFigure3_year_distributions.R --- R scriptFigure4_correlations_between_latent_variables.R --- R scriptFigure5_top1percent_barplot.R --- R scriptFigure6_Spearman_correlations.R --- R scriptFigure7_yearly_mean_plots.R --- R scriptFigure8_yearly_mean_plots.R --- R scriptFigure9_VDEM_humanrights_trends_1946_2016.R
M_1_Full_Data.csv ---  latent variable estimates from the constant standard model (Fariss 2014, 2019)M_2_Full_Data.csv --- latent variable estimates from the changing standard model (Fariss 2014, 2019)M_All_Vary_Full_Data.csv --- latent variable estimates from the all varying standard model (Cingranelli and Filipov 2018)
progressive_no_events_summary_amnesty.csv --- latent variable estiamtes with subst of items progressive_no_events_summary_amnesty.RData --- latent variable with subst of items progressive_no_events_summary_disap.csv --- latent variable with subst of items progressive_no_events_summary_disap.RData --- latent variable with subst of items progressive_no_events_summary_genocide.csv --- latent variable with subst of itemsprogressive_no_events_summary_genocide.RData --- latent variable with subst of itemsprogressive_no_events_summary_hathaway.csv --- latent variable with subst of itemsprogressive_no_events_summary_hathaway.RData --- latent variable with subst of itemsprogressive_no_events_summary_kill.csv --- latent variable with subst of itemsprogressive_no_events_summary_kill.RData --- latent variable with subst of itemsprogressive_no_events_summary_state.csv --- latent variable with subst of itemsprogressive_no_events_summary_state.RData --- latent variable with subst of itemsprogressive_no_events_summary_tort.csv --- latent variable with subst of itemsprogressive_no_events_summary_tort.RData --- latent variable with subst of itemsprogressive_summary_amnesty.csv --- latent variable with subst of itemsprogressive_summary_amnesty.RData --- latent variable with subst of itemsprogressive_summary_disap.csv --- latent variable with subst of itemsprogressive_summary_disap.RData --- latent variable with subst of itemsprogressive_summary_events.csv --- latent variable with subst of itemsprogressive_summary_events.RData --- latent variable with subst of itemsprogressive_summary_hathaway.csv --- latent variable with subst of itemsprogressive_summary_hathaway.RData --- latent variable with subst of itemsprogressive_summary_hrw.csv --- latent variable with subst of itemsprogressive_summary_hrw.RData --- latent variable with subst of itemsprogressive_summary_itt.csv --- latent variable with subst of itemsprogressive_summary_itt.RData --- latent variable with subst of itemsprogressive_summary_kill.csv --- latent variable with subst of itemsprogressive_summary_kill.RData --- latent variable with subst of itemsprogressive_summary_polpris.csv --- latent variable with subst of itemsprogressive_summary_polpris.RData --- latent variable with subst of itemsprogressive_summary_tort.csv --- latent variable with subst of itemsprogressive_summary_tort.RData --- latent variable with subst of itemsV-Dem-DS-CY-v7.csv --- Varities of Democracy dataset

# ---------------------------------------------------------------------------------------------------- #
# References
# ---------------------------------------------------------------------------------------------------- #

Fariss, Christopher J. 2014. “Respect for Human Rights has Improved Over Time: Modeling the Chang- ing Standard of Accountability in Human Rights Documents.” American Political Science Review 108(2):297–318.


# ---------------------------------------------------------------------------------------------------- #
# end file
# ---------------------------------------------------------------------------------------------------- #
